require(['modules/fetch'],function(fetch){
    
    //loadStoryList();
    var loadStoryListFn = function (){
        fetch('listStory', { ps: 120, pn: 0},
            function (result) {
                if(0 == result.errno ){
                    vueMainData.sidebarDataList = result.data.list;
                }
            },
            function(data) {
                console.log("ajax faild");
            }
        );
    }

    

    //main
    var vueMainData = {
        htmlContent: '',
        storyInfo:{},

        sidebarDataList: [],
    };
    new Vue({
        el: "#vue-app",
        data: vueMainData,
        methods:{
            sidebarItemClick: function(item,index){
                //getStoryInfo(parseInt(item.story_id));
                location.href="/story/readStory?story_id=" + parseInt(item.story_id);
                // console.log(index,item);
            }
        }
    });
    
    loadStoryListFn();
});